import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;


public class ControleurControleBateau implements ChangeListener {
	private ModelIHM monModelIHM;
	
	public ControleurControleBateau() {
			super();
	}

	public void setModelIHM(ModelIHM mIHM){
		monModelIHM = mIHM;
		
	}
	@Override
	public void stateChanged(ChangeEvent e) {
		JSlider mSlider;
		try{
			mSlider = (JSlider) e.getSource();
			if (mSlider.getName().compareTo("Vitesse") == 0){
				monModelIHM.getModelControleBateau().setVitesse(mSlider.getValue());
			}
			if (mSlider.getName().compareTo("Gourvernaille") == 0){
				monModelIHM.getModelControleBateau().setGourvernaille(mSlider.getValue());
			}
			
		}
		finally{
			
		}
		
	}

}
